import request from '@/utils/request'

// 提交提现申请
export function submitWithdraw(data) {
  return request({
    url: '/apartment/withdraw',
    method: 'post',
    data
  })
}

// 获取提现记录列表
export function getWithdrawList(query) {
  return request({
    url: '/apartment/withdraw/list',
    method: 'get',
    params: query
  })
}

// 取消提现申请
export function cancelWithdraw(withdrawId) {
  return request({
    url: `/apartment/withdraw/cancel/${withdrawId}`,
    method: 'post'
  })
}

// 获取提现关联账单
export function getAssociateBills(withdrawId, query) {
  return request({
    url: `/apartment/withdraw/associate-bills/${withdrawId}`,
    method: 'get',
    params: query
  })
}

export default {
  submitWithdraw,
  getWithdrawList,
  cancelWithdraw,
  getAssociateBills
} 